home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-18 | 4.3 KB | 205 lines | [TEXT/MPS ] |
-
- /*
-
- DumpSRec -- an MPW Tool
-
- Required files to build:
- DumpSRec.c
- DumpSRec.r
- DumpSRec.rsrc
- DumpSRec.make
-
- Written by Craig Prouse of Apple Developer Technical Support
- Special thanks to C.K. Haun for the original Commando interface!
- Copyright © 1990-91, Apple Computer, Inc. -- ALL RIGHTS RESERVED
-
- This tool converts an arbitrary Macintosh data file or resource into
- Motorola S-Record format, most likely to assist in downloading code
- and data to EPROM programmers or non-Macintosh target platforms.
-
- Command line syntax:
-
- DumpSRec # write resource or data in S-Record format
- DumpSRec [option…] fileName > dump ≥ progress
- -a addr # dump to hexadecimal target address (default = 0)
- -b count # include count data bytes per record (default = 32)
- -h # suppress S0 header record
- -nh # specify new data for the S0 header record
- -rt type[=id] # dump resource with this type and id (default is data fork)
- -s1 # generate S1 records, 2-byte addresses (default)
- -s2 # generate S2 records, 3-byte addresses
- -s3 # generate S3 records, 4-byte addresses
- -x addr # hexadecimal target execution address (default = 0)
-
- */
-
-
-
- #include "cmdo.r"
- #include "SysTypes.r"
-
-
-
- type 'SHDR' {
- unsigned hex integer;
- wstring[252];
- };
-
-
-
- resource 'SHDR' (0) {
- 0, /* S0 record typically has a nil address field */
- "" /* default is no header data */
- };
-
-
-
- resource 'vers' (1) {
- 0x01,
- 0x00,
- development,
- 0x03,
- verUs,
- "1.0d3",
- "1.0d3, Copyright © 1990-91 Apple Computer, Inc."
- };
-
-
-
- resource 'cmdo' (128, "DumpSRec") {
- { 280,
- "This tool converts either the data fork or a single resource from an "
- "arbitrary file into Motorola S-Record format.",
-
- { NotDependent {},
- Files {
- InputFile,
- RequiredFile {
- {33, 19, 53, 132},
- "Dump File…",
- "",
- "Select a file to dump. The default data to dump is "
- "that in the data fork. Enter a resource ID in the appropriate "
- "field to dump a resource instead."
- },
- Additional {
- "",
- "",
- "",
- "",
- {}
- }
- },
-
- NotDependent {},
- Redirection {
- StandardOutput,
- {70, 20}
- },
-
- NotDependent {},
- Redirection {
- DiagnosticOutput,
- {120, 20}
- },
-
- NotDependent {},
- CheckOption {
- NotSet,
- {90, 150, 106, 300},
- "Suppress S0 Header",
- "-h",
- "Suppress generation of the S0 header record."
- },
-
- Or { {-4} },
- CheckOption {
- NotSet,
- {110, 150, 126, 300},
- "New S0 Data…",
- "-nh",
- "Prompt for a new S0 header record. (A dialog allows text entry of "
- "new data for the S0 record. The text is saved in the system folder "
- "and will be used until the data is changed again or deleted.)"
- },
-
- NotDependent {},
- RadioButtons {
- { /* 1 */
- {80, 305, 96, 465},
- "Generate S1 Records", "", Set,
- "Generate 2-byte addresses (default).",
- /* 2 */
- {100, 305, 116, 465},
- "Generate S2 Records", "-s2", NotSet,
- "Generate 3-byte addresses.",
- /* 3 */
- {120, 305, 136, 465},
- "Generate S3 Records", "-s3", NotSet,
- "Generate 4-byte addresses."
- }
- },
-
- NotDependent {},
- RegularEntry {
- "Resource ID:",
- {19, 165, 35, 250},
- {45, 155, 61, 270},
- "",
- ignoreCase,
- "-rt",
- "Dump resource with this type and id (default = data fork).\n"
- "Enter in the form \"FONT=12\"."
- },
-
- NotDependent {},
- RegularEntry {
- "Load Address:",
- {19, 283, 35, 377},
- {45, 295, 61, 365},
- "",
- ignoreCase,
- "-a",
- "Specify hexadecimal target load address (default = 0)."
- },
-
- NotDependent {},
- RegularEntry {
- "Entry Point:",
- {19, 386, 35, 464},
- {45, 390, 61, 460},
- "",
- ignoreCase,
- "-x",
- "Specify hexadecimal target execution address (default = 0)."
- },
-
- NotDependent {},
- RegularEntry {
- "Bytes per Line:",
- {145, 205, 171, 305},
- {145, 315, 161, 345},
- "",
- ignoreCase,
- "-b",
- "Specify number of data bytes represented in each S-Line "
- "(default = 32)."
- },
-
- Or { {1} },
- DoItButton {},
-
- NotDependent {},
- VersionDialog {
- VersionString {
- "1.0d3"
- },
- "DumpSRec 1.0d3 by Craig Prouse, "
- "Copyright © 1990-91 Apple Computer, Inc.\n"
- "Special thanks to C.K. Haun for the original Commando interface!",
- 0
- }
- }
- }
- };
-